//
//  ViewController.swift/code/untitled folder/firstDemo/Podfile
//  firstDemo
//
//  Created by AINI on 2018/12/20.
//  Copyright © 2018年 AINI. All rights reserved.
//

import UIKit
import SnapKit
import Toast_Swift

class Home: UIViewController{
    var table:UITableView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let screenWidth = UIScreen.main.bounds.width
        let head = UIView()
        head.frame = CGRect(x: 0, y: 0, width: screenWidth, height: 200)
        head.backgroundColor = UIColor.init(red: 1, green: 148/255, blue: 47/255, alpha: 1)
        view.addSubview(head)
        let message = UIImageView(image:UIImage(named:"ico-active"));
         view.addSubview(message)
        message.snp.makeConstraints { (make) in
            make.width.equalTo(20)
            make.height.equalTo(20)
            make.top.equalTo(head.snp.top).offset(50)
            make.right.equalTo(head.snp.right).offset(-80)
        }
        let set = UIImageView(image:UIImage(named:"ico-comment"));
        view.addSubview(set)
        set.snp.makeConstraints { (make) in
            make.width.equalTo(20)
            make.height.equalTo(17)
            make.top.equalTo(head.snp.top).offset(50)
            make.right.equalTo(head.snp.right).offset(-35)
        }
        let avatar = UIImageView(image:UIImage(named:"avatar"));
         avatar.layer.cornerRadius = 63
        view.addSubview(avatar)
        avatar.snp.makeConstraints { (make) in
            make.width.height.equalTo(63)
            make.left.equalTo(head.snp.left).offset(30)
            make.bottom.equalTo(head.snp.bottom).offset(-31)
        }
        let name  = UILabel()
        view.addSubview(name)
        name.font = UIFont.systemFont(ofSize: 15)
        name.numberOfLines = 1;
        name.text = "Angelbady"
        name.textColor = UIColor.white
        name.snp.makeConstraints { (make) in
            make.top.equalTo(avatar.snp.top).offset(10)
            make.left.equalTo(avatar.snp.right).offset(10)
        }
        let tip = UILabel()
        view.addSubview(tip)
        tip.font = UIFont.systemFont(ofSize: 12)
        tip.numberOfLines = 1;
        tip.text = "粉丝32   关注21    动态12"
        tip.textColor = UIColor.white
        tip.snp.makeConstraints { (make) in
            make.top.equalTo(avatar.snp.top).offset(40)
            make.left.equalTo(avatar.snp.right).offset(10)
        }
        let sign = UIView()
        view.addSubview(sign);
        sign.backgroundColor = UIColor.white
        sign.layer.cornerRadius = 12
        sign.snp.makeConstraints { (make) in
            make.width.equalTo(72)
            make.height.equalTo(24)
            make.right.equalTo(view.snp.right).offset(10)
            make.top.equalTo(view.snp.top).offset(90)
        }
        let signIco = UIImageView(image:UIImage(named:"ico-good"));
        sign.addSubview(signIco)
        signIco.snp.makeConstraints { (make) in
            make.width.height.equalTo(16)
            make.left.equalTo(sign.snp.left).offset(10)
            make.centerY.equalTo(sign)
        }
        let signLabel = UILabel();
        sign.addSubview(signLabel);
        signLabel.textColor = UIColor.init(red: 1, green: 148/255, blue: 47/255, alpha: 1);
        signLabel.font = UIFont.systemFont(ofSize: 12)
        signLabel.text = "签到"
        signLabel.numberOfLines = 0;
        signLabel.snp.makeConstraints { (make) in
            make.left.equalTo(signIco.snp.right).offset(4)
            make.centerY.equalTo(sign)
        }
    }
}

